package com.seelyn.rhea.integrate.spring;

import com.seelyn.rhea.mvc.context.Request;
import com.seelyn.rhea.mvc.context.Response;
import com.seelyn.rhea.mvc.internal.InternalResolver;
import com.seelyn.rhea.mvc.internal.InternalRoute;
import com.seelyn.rhea.mvc.render.View;
import com.seelyn.rhea.mvc.route.Resolver;
import com.seelyn.rhea.mvc.route.Route;

/**
 * @author linfeng
 * @since 2016/1/28
 */
public class InternalResolverImpl extends InternalResolver {

    private final String method;
    private final Resolver resolver;
    private final String path;

    public InternalResolverImpl(String path, String method, Resolver resolver) {
        super(path);
        this.path = path;
        this.method = method;
        this.resolver = resolver;
    }

    @Override
    public String getPath() {
        return path;
    }

    @Override
    public void handle(Request request, Response response, Exception ex) {
        resolver.handle(request, response, ex);
    }


    public String getMethod() {
        return method;
    }

    public Resolver getRoute() {
        return resolver;
    }
}
